﻿// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Runtime/UMG/Public/Blueprint/UserWidget.h"
#include "BasicWidget.generated.h"

UENUM(BlueprintType)
enum class EParametricTType : uint8
{
	EquidistantT,
	ChordLengthT,
	CentripetalT,
	FoleyT
};

/**
 * 
 */
UCLASS()
class GAMES102_API UBasicWidget : public UUserWidget
{
	GENERATED_BODY()

	// 多项式插值
	UFUNCTION(BlueprintCallable)
	TArray<FVector2D> GeneratePolynomialInterpolationPoint(TArray<FVector2D> input, int n);

	// 高斯基函数插值
	UFUNCTION(BlueprintCallable)
	TArray<FVector2D> GenerateGaussBasisInterpolationPoint(TArray<FVector2D> input, int n, double sigma = 1.0, bool bUseAutoSigma = true);

	// 多项式最小二乘逼近
    UFUNCTION(BlueprintCallable)
    TArray<FVector2D> GeneratePolynomialFitPoint(TArray<FVector2D> input, int n, int m);

	// 岭回归最小二乘逼近
    UFUNCTION(BlueprintCallable)
    TArray<FVector2D> GenerateRidgeRegressionFitPoint(TArray<FVector2D> input, int n, int m, double lambda);

	// 等距参数话
    UFUNCTION(BlueprintCallable)
    TArray<FVector2D> GenerateParametricCurvePoint(TArray<FVector2D> input, int n, int m, EParametricTType type);
};
